package com.hgk.common.common.util;

public class BallSharedPreferencesUtil {
	public static final boolean IS_UPLOAD_ORIGINAL_IMAGE = false;
	private static final String KEY_PRIVATE = "is_private";
	private static final String KEY_ORIGINAL = "is_original";
	private static final String KEY_NEW_PRIVATE = "new_private";

	public static int isRecordPrivate() {
		boolean isSet = BallSharedPreferences.getInstance().getIntConfig(KEY_NEW_PRIVATE, -1) >= 0;
		if (!isSet) {
			boolean isPrivate = BallSharedPreferences.getInstance().getBooleanConfig(KEY_PRIVATE, false);
			int newDefault = isPrivate ? 1 : 0;
			return BallSharedPreferences.getInstance().getIntConfig(KEY_NEW_PRIVATE, newDefault);
		}
		return BallSharedPreferences.getInstance().getIntConfig(KEY_NEW_PRIVATE, 3);
	}
	
	public static void setRecordPrivate(int limit) {
		BallSharedPreferences.getInstance().saveIntConfig(KEY_NEW_PRIVATE, limit);
	}


	public static boolean isUploadOriginalImage() {
		return BallSharedPreferences.getInstance().getBooleanConfig(KEY_ORIGINAL, IS_UPLOAD_ORIGINAL_IMAGE);
	}
	
	public static void setUploadOriginalImage(boolean isOriginal) {
		BallSharedPreferences.getInstance().saveBooleanConfig(KEY_ORIGINAL, isOriginal);
	}
}